home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_vol_sharkwaypoints.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  120 lines

  1. # Jones 3D Cog Script
  2. #
  3. # vol_SharkWayPoints.cog
  4. #
  5. # setup and run sharks on a grid in the vol shark cave area
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. #.......................MESSAGES.....................    
  14.     message     startup
  15.     message     entered
  16.     message     user0
  17.     
  18.     
  19. #.......................ACTORS.....................    
  20.     thing       player                          local
  21.     
  22.     thing       t_shark00                         
  23.     thing       t_shark01                         
  24.                         
  25. #.......................COGS.....................
  26.     cog            boatcog
  27.  
  28. #.......................WAY POINTS.....................    
  29.     thing        t_ghost00
  30.     thing        t_ghost01
  31.     thing        t_ghost02
  32.     thing        t_ghost03
  33.     thing        t_ghost04
  34.     thing        t_ghost05
  35.     thing        t_ghost06
  36.     thing        t_ghost07
  37.     thing        t_ghost08
  38.     thing        t_ghost09
  39.     
  40.  
  41. #.......................TRIGGERS.....................
  42.     sector        way_trig    
  43.  
  44.  
  45. #.......................VARIABLES.....................
  46.     int            n_pos                            local                
  47.     int            n_crossed=0                        local                
  48.     int            curShark                        local                
  49.     
  50. end
  51.  
  52. # ========================================================================================
  53.  
  54. code
  55.  
  56. startup:
  57.  
  58.     Sleep(0.5);
  59.     player = GetLocalPlayerThing();
  60.     
  61. return;    
  62.     
  63. # ========================================================================================
  64. entered:    
  65.     
  66. If (n_crossed == 1) return;
  67. If ((GetSenderRef() == way_trig) && (GetSourceRef() == player))
  68. {
  69.  
  70. n_crossed=1;    # the grid will not be set twice
  71.  
  72. for (n_pos = 0; n_pos <= 9; n_pos = n_pos+1)
  73.     {
  74.         AISetWpnt(t_ghost00[n_pos], n_pos);     //assigns each waypoint slot a ghost object 
  75.     }
  76.     
  77.     // LINK WAYPOINTS TO FORM THE GRID STRUCTURE
  78.     AIConnectWpnts(0, 1);
  79.     AIConnectWpnts(0, 3);
  80.     AIConnectWpnts(1, 2);
  81.     AIConnectWpnts(1, 3);
  82.     AIConnectWpnts(2, 6);
  83.     AIConnectWpnts(2, 3);
  84.     AIConnectWpnts(3, 4);
  85.     AIConnectWpnts(4, 5);
  86.     AIConnectWpnts(5, 6);
  87.     AIConnectWpnts(6, 7);
  88.     AIConnectWpnts(7, 8);
  89.     AIConnectWpnts(8, 9);
  90.     AIConnectWpnts(9, 1);
  91.  
  92. }
  93. return;
  94.  
  95.     
  96. # ========================================================================================
  97. user0:
  98.  
  99. if (GetSenderRef != boatcog) return;
  100. curShark=GetParam(0);
  101.  
  102. if (curShark == t_shark00)
  103.     {
  104.     AISetInstinctWpntMode(t_shark00); 
  105.     AIEnableInstinct(t_shark00, "roam", 1);
  106.     }
  107.  
  108. if (curShark == t_shark01)
  109.     {
  110.     AISetInstinctWpntMode(t_shark01); 
  111.     AIEnableInstinct(t_shark01, "roam", 1);
  112.     }
  113.  
  114.  
  115. return;
  116.  
  117. # ========================================================================================
  118. end
  119.  
  120.